//
//  SeparateCounter.swift
//  SwiftUIState
//
//  Created by 李煜 on 2024/7/31.
//

import SwiftUI

struct SeparateCounter: View {
  @State private var one: Int = 0
  @State private var two: Int = 0
  @State private var three: Int = 0

  var body: some View {
    VStack {
      Text("\(one + two + three)")
        .frame(width: 300, height: 300)
        .padding()
        .font(.system(size: 120, weight: .black, design: .rounded))
      HStack {
        Counter(count: $one, bgColor: .blue)
        Counter(count: $two, bgColor: .green)
        Counter(count: $three, bgColor: .red)
      }
      
    }
  }
}


#Preview {
  SeparateCounter()
}
